package com.ruoyi.parking.service.impl;

import com.ruoyi.parking.domain.ParkWhitelist;
import com.ruoyi.parking.dto.WhitelistAndCar;
import com.ruoyi.parking.mapper.ParkWhitelistMapper;
import com.ruoyi.parking.service.IParkWhitelistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 白名单Service业务层处理
 * 
 * @author chenkai
 * @date 2025-02-10
 */
@Service
public class ParkWhitelistServiceImpl implements IParkWhitelistService 
{
    @Autowired
    private ParkWhitelistMapper parkWhitelistMapper;

    /**
     * 查询白名单
     * 
     * @param whitelistId 白名单主键
     * @return 白名单
     */
    @Override
    public ParkWhitelist selectParkWhitelistByWhitelistId(Integer whitelistId)
    {
        return parkWhitelistMapper.selectParkWhitelistByWhitelistId(whitelistId);
    }

    /**
     * 查询白名单列表
     * 
     * @param parkWhitelist 白名单
     * @return 白名单
     */
    @Override
    public List<WhitelistAndCar> selectParkWhitelistList(WhitelistAndCar whitelistAndCar)
    {
        return parkWhitelistMapper.selectParkWhitelistList(whitelistAndCar);
    }

    /**
     * 新增白名单
     * 
     * @param parkWhitelist 白名单
     * @return 结果
     */
    @Override
    public int insertParkWhitelist(ParkWhitelist parkWhitelist)
    {
        return parkWhitelistMapper.insertParkWhitelist(parkWhitelist);
    }

    /**
     * 修改白名单
     * 
     * @param parkWhitelist 白名单
     * @return 结果
     */
    @Override
    public int updateParkWhitelist(ParkWhitelist parkWhitelist)
    {
        return parkWhitelistMapper.updateParkWhitelist(parkWhitelist);
    }

    /**
     * 批量删除白名单
     * 
     * @param whitelistIds 需要删除的白名单主键
     * @return 结果
     */
    @Override
    public int deleteParkWhitelistByWhitelistIds(Integer[] whitelistIds)
    {
        return parkWhitelistMapper.deleteParkWhitelistByWhitelistIds(whitelistIds);
    }

    /**
     * 删除白名单信息
     * 
     * @param whitelistId 白名单主键
     * @return 结果
     */
    @Override
    public int deleteParkWhitelistByWhitelistId(Integer whitelistId)
    {
        return parkWhitelistMapper.deleteParkWhitelistByWhitelistId(whitelistId);
    }
}
